<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
</head>
<body>



 用户名：<input type="text" name="username"><br>
 身份：<input type="text" name="identity"><br>
 密码：<input type="password" name="password"><br>
 <input type="submit" value="注册"></input><br>


</body>
</html>
<script src="./js/axios.min.js"/>

<script>
    document.querySelector("#bt-submit")
        .onclick=function () {
        const username=document.querySelector("input[name='username']").value;
        const identity=document.querySelector("input[name='identity']").value;
        const password=document.querySelector("input[name='password']").value;

        const url ='/user/register'
        const data ={
            'username':username,
            'password':password,
            'identity':identity,



        }

        axios.post(url,data).then(res =>{
            const R = res.data
            console.log(R)
            if (R.code===200){
                location.href='index.html'
            }else{
                alert(R.msg)
            }
        })
    }


</script>